3.3 \(\int \frac{\sin ^2(x)}{a+a \cos (x)} \, dx\)

Optimal. Leaf size=13 \[ \frac{x}{a}-\frac{\sin (x)}{a} \]

[Out]

x/a - Sin[x]/a

________________________________________________________________________________________

Rubi [A]  time = 0.0377543, antiderivative size = 13, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.154, Rules used = {2682, 8} \[ \frac{x}{a}-\frac{\sin (x)}{a} \]

Antiderivative was successfully verified.

[In]

Int[Sin[x]^2/(a + a*Cos[x]),x]

[Out]

x/a - Sin[x]/a

Rule 2682

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(g*(g*Cos[e
 + f*x])^(p - 1))/(b*f*(p - 1)), x] + Dist[g^2/a, Int[(g*Cos[e + f*x])^(p - 2), x], x] /; FreeQ[{a, b, e, f, g
}, x] && EqQ[a^2 - b^2, 0] && GtQ[p, 1] && IntegerQ[2*p]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \frac{\sin ^2(x)}{a+a \cos (x)} \, dx &=-\frac{\sin (x)}{a}+\frac{\int 1 \, dx}{a}\\ &=\frac{x}{a}-\frac{\sin (x)}{a}\\ \end{align*}

Mathematica [A]  time = 0.0082069, size = 17, normalized size = 1.31 \[ \frac{2 \left (\frac{x}{2}-\frac{\sin (x)}{2}\right )}{a} \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[x]^2/(a + a*Cos[x]),x]

[Out]

(2*(x/2 - Sin[x]/2))/a

________________________________________________________________________________________

Maple [B]  time = 0.047, size = 31, normalized size = 2.4 \begin{align*} -2\,{\frac{\tan \left ( x/2 \right ) }{a \left ( \left ( \tan \left ( x/2 \right ) \right ) ^{2}+1 \right ) }}+2\,{\frac{\arctan \left ( \tan \left ( x/2 \right ) \right ) }{a}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)^2/(a+a*cos(x)),x)

[Out]

-2/a*tan(1/2*x)/(tan(1/2*x)^2+1)+2/a*arctan(tan(1/2*x))

________________________________________________________________________________________

Maxima [B]  time = 1.6375, size = 57, normalized size = 4.38 \begin{align*} \frac{2 \, \arctan \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a} - \frac{2 \, \sin \left (x\right )}{{\left (a + \frac{a \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}\right )}{\left (\cos \left (x\right ) + 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)^2/(a+a*cos(x)),x, algorithm="maxima")

[Out]

2*arctan(sin(x)/(cos(x) + 1))/a - 2*sin(x)/((a + a*sin(x)^2/(cos(x) + 1)^2)*(cos(x) + 1))

________________________________________________________________________________________

Fricas [A]  time = 1.57096, size = 22, normalized size = 1.69 \begin{align*} \frac{x - \sin \left (x\right )}{a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)^2/(a+a*cos(x)),x, algorithm="fricas")

[Out]

(x - sin(x))/a

________________________________________________________________________________________

Sympy [B]  time = 0.50154, size = 46, normalized size = 3.54 \begin{align*} \frac{x \tan ^{2}{\left (\frac{x}{2} \right )}}{a \tan ^{2}{\left (\frac{x}{2} \right )} + a} + \frac{x}{a \tan ^{2}{\left (\frac{x}{2} \right )} + a} - \frac{2 \tan{\left (\frac{x}{2} \right )}}{a \tan ^{2}{\left (\frac{x}{2} \right )} + a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)**2/(a+a*cos(x)),x)

[Out]

x*tan(x/2)**2/(a*tan(x/2)**2 + a) + x/(a*tan(x/2)**2 + a) - 2*tan(x/2)/(a*tan(x/2)**2 + a)

________________________________________________________________________________________

Giac [A]  time = 1.10746, size = 34, normalized size = 2.62 \begin{align*} \frac{x}{a} - \frac{2 \, \tan \left (\frac{1}{2} \, x\right )}{{\left (\tan \left (\frac{1}{2} \, x\right )^{2} + 1\right )} a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)^2/(a+a*cos(x)),x, algorithm="giac")

[Out]

x/a - 2*tan(1/2*x)/((tan(1/2*x)^2 + 1)*a)